home *** CD-ROM | disk | FTP | other *** search
- ;TIP586.LSP Visual Layer Selection (c)1990 G. Ramesh
- (defun c:layerset (/ LLIST L I CLAY LEN K)
- (setvar "CMDECHO" 0)
- (setq LLIST nil
- L (tblnext "LAYER" T)
- I 0
- )
- (while L
- (setq LLIST (append LLIST (list (cdr (assoc 2 L))))
- L (tblnext "LAYER")
- )
- )
- (setq CLAY (getvar "CLAYER")
- LEN (length LLIST)
- LLIST (append (member CLAY LLIST)(reverse (cdr (member
- CLAY (reverse LLIST)))) )
- )
- (prompt "\n\t Press space bar to scan layers on status line")
- (prompt "\n\t\t Press RETURN to set that layer...")
- (grtext -1 (strcat "Layer " (car LLIST) " "))
- (setq K (cadr (grread)))
- (while (or (/= K 13)(= K 8)(= K 32))
- (cond ((= K 32)(setq I (1+ I)))
- ((= K 8)(setq I (1- I)))
- )
- (cond ((minusp I)(setq I (1- LEN)))
- ((= I LEN)(SETQ I 0))
- )
- (grtext -1 (strcat "Layer " (nth I LLIST) " "))
- (setq K (cadr (grread)))
- )
- (command "layer" "s" (nth I LLIST) "")
- (prompt "Done.")(prin1)
- )
-